<template>
  <div class="bnh-postauth-container">
    <div class="bnh-postauth-item border flex flex-align-center">
      <p class="flex-1">真实姓名：</p>
      <input type="text" placeholder="未填写" v-model='Name'>
    </div>
    <div class="bnh-postauth-item border flex flex-align-center">
      <p class="flex-1">身份证号：</p>
      <input type="text" placeholder="未填写" v-model='cardNo'>
    </div>
    <div class="PhotoBox">
        <p class="bnh-title">身份证照片：</p>
        <div class="PhotoBox-z">
            <img :src="PhotoBoxzUrl" alt="" v-show='PhotoBoxzUrl'>
        </div>
        <div class="PhotoBox-f">
            <img :src="PhotoBoxfUrl" alt="" v-show='PhotoBoxfUrl'>
        </div>
    </div>
     <div class="bnh-login-btn flex flex-align-center flex-pack-center" @click="onPost">
            <p>提交</p>
      </div> 
  </div>
</template>
<script>
	import http from '../utils/http'
	import api from '../utils/api'
	import utils from '../utils/utils'
export default {
  created(){ //页面初始化时修改网页标题
			window.document.title = '认证';
    },
    data(){
      return{
        PhotoBoxzUrl:'http://www.baidu.com', //身份证正面照片URL
        PhotoBoxfUrl:'http://www.baidu.com', //身份证反面照片URL
        cardNo:'500101199506038972',
        Name:'向小军',
      }
    },
    methods:{
      onPost:async function(){ //提交资料
       let params = {idcardFrontImgur:this.PhotoBoxzUrl,idcardBackImgurl:this.PhotoBoxfUrl,idcard:this.cardNo,name:this.Name,dealerId:localStorage.id}
            const res = await http.post(api.updateDealer, params);
          if (res.data.success) {
                 this.$vux.toast.text(res.data.message, 'middle');
			 }else{
               this.$vux.toast.text(res.data.message, 'middle');
        }
      }
    }
}
</script>
<style scoped>
.bnh-postauth-item{height: 1.2rem}
.bnh-postauth-item p{margin-left: 0.3rem}
.bnh-postauth-item input{width: 3rem;margin-right: 0.3rem;text-align: right;border:none;font-size: 0.3rem}
.PhotoBox{height: 4.28rem;width: 6rem;margin-top: 0.4rem;margin-left: 0.3rem;position: relative}
.bnh-login-btn{height: 0.95rem;width: 7rem;margin: 0 auto;border-radius: 25px;background: #ffaf3c;color: #fff;font-size: 0.32rem;margin-top: 0.9rem}
.bnh-title{position: absolute;}
.PhotoBox-z{height: 1.94rem;width: 3.44rem;border:1px #ccc dashed;position: absolute;top: 0.2rem;left: 2.4rem;text-align:center;background:url('~@/assets/img/auth-z.png')center center no-repeat; background-size: 100% auto;}
.PhotoBox-z img{height: 1.87rem;width: 100%}
.PhotoBox-f{height: 1.94rem;width: 3.44rem;border:1px #ccc dashed;position: absolute;top: 2.3rem;left: 2.4rem;text-align:center;background:url('~@/assets/img/auth-f.png')center center no-repeat; background-size: 100% auto;}
.PhotoBox-f img{height: 1.87rem;width: 100%}
</style>


